<!--
 * @Author: zsc
 * @Date: 2022-06-16 23:23:03
 * @LastEditors: zsc
 * @LastEditTime: 2022-06-26 14:30:49
 * @Description:
-->
<template>
  <el-dialog
    :before-close="beforeClose"
    :visible.sync="show"
    :title="title"
    width="35%"
    @close="close"
    @closed="closed"
  >
    <el-calendar v-model="calendarDate" />

  </el-dialog>
</template>

<script>

export default {
  name: 'Index',
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    type: {
      type: String,
      default: 'view'
    },
    data: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      show: false,
      title: '考勤列表',
      calendarDate: new Date(),
      form: {
        ssq: '',
        street: '',
        admin: '',
        remark: ''
      }
    }
  },
  computed: {

  },
  watch: {
    visible(val) {
      if (val) {
        this.show = val
      }
    }
  },
  mounted() {
    this.show = this.visible
  },
  methods: {
    handleChange(value) {
      console.log(value)
    },
    getData() {
      console.log('获取数据')
    },
    handleClose() {
      console.log('点击关闭')
      this.beforeClose()
    },
    handleSubmit() {
      console.log('点击确定')
      this.$notify.success('保存成功')
      this.handleClose()
    },
    beforeClose() {
      console.log('关闭前的回调')
      this.show = false
      this.$emit('update:visible', false)
    },
    close() {
      console.log('关闭的回调')
    },
    closed() {
      console.log('关闭动画结束后的回调')
    }
  }
}
</script>

<style scoped>
</style>
